//
//  BBGlobalSingleton.h
//  BabyThermometer
//
//  Created by CaiLei on 10/2/14.
//  Copyright (c) 2014 baohu. All rights reserved.
//

#import <Foundation/Foundation.h>
#define Noti_SignUp @"SignUp Successful"
#define Noti_SignIn @"SignIn Successful"
typedef NS_ENUM(NSUInteger, SignComeFrom) {
    SignComeFrom_UnKnown,
    SignComeFrom_Settings,
    SignComeFrom_MainPageRightItem,
    SignComeFrom_BabyIcon
};

@interface BBUserInfo : JSONModel
@property (nonatomic, copy) NSString<Optional> *phone;
@property (nonatomic, copy) NSString<Optional> *password;
@property (nonatomic, copy) NSString<Optional> *token;
@property (nonatomic, strong) NSNumber<Optional> *bIsLogin;
@end

@interface BBBabyInfo : JSONModel
@property (nonatomic, strong) UIImage<Ignore> *icon;
@property (nonatomic, copy) NSString<Optional> *sex;
@property (nonatomic, copy) NSString<Optional> *nickname;
@property (nonatomic, strong) NSDate<Ignore> *birthday;

@property (nonatomic, copy) NSString<Ignore> *iconStr;
@property (nonatomic, copy) NSString<Ignore> *birthdayStr;
@end

@interface BBGlobalSingleton : NSObject
+ (BBGlobalSingleton *)sharedInstance;

+ (void)setupCore;
+ (void)clearCore;

@property (nonatomic, strong) BBUserInfo *currentUser;
@property (nonatomic, strong) NSMutableArray *babyArray;
@property (nonatomic, assign) SignComeFrom gSignComeFrom;
- (void)saveToDisk;
- (void)loadFromDisk;
@end

#pragma mark - c func
BOOL isEmpty(id aItem);
